using System;
using Betfair.Api.Types;
using Newtonsoft.Json;

namespace Betfair.Api
{
    public sealed class MarketDescription
    {
        public MarketDescription(bool isPersistent, bool isBsp, DateTime startTime, DateTime suspendTime,
            DateTime settleTime, BettingType bettingType, bool isInPlayEnabled, string marketType, string regulator,
            double baseRate, bool hasDiscount, string wallet, string rules, bool rulesHasDate, string clarifications)
        {
            IsPersistent = isPersistent;
            IsBsp = isBsp;
            StartTime = startTime;
            SuspendTime = suspendTime;
            SettleTime = settleTime;
            BettingType = bettingType;
            IsInPlayEnabled = isInPlayEnabled;
            MarketType = marketType;
            Regulator = regulator;
            BaseRate = baseRate;
            HasDiscount = hasDiscount;
            Wallet = wallet;
            Rules = rules;
            RulesHasDate = rulesHasDate;
            Clarifications = clarifications;
        }

        [JsonProperty("persistenceEnabled")]
        public bool IsPersistent { get; private set; }

        [JsonProperty("bspMarket")]
        public bool IsBsp { get; private set; }

        [JsonProperty("marketTime")]
        public DateTime StartTime { get; private set; }

        [JsonProperty("suspendTime")]
        public DateTime SuspendTime { get; private set; }

        [JsonProperty("settleTime")]
        public DateTime SettleTime { get; private set; }

        [JsonProperty("bettingType")]
        public BettingType BettingType { get; private set; }

        [JsonProperty("turnInPlayEnabled")]
        public bool IsInPlayEnabled { get; private set; }

        [JsonProperty("marketType")]
        public string MarketType { get; private set; }

        [JsonProperty("Regulator")]
        public string Regulator { get; private set; }

        [JsonProperty("marketBaseRate")]
        public double BaseRate { get; private set; }

        [JsonProperty("discountAllowed")]
        public bool HasDiscount { get; private set; }

        [JsonProperty("wallet")]
        public string Wallet { get; private set; }

        [JsonProperty("rules")]
        public string Rules { get; private set; }

        [JsonProperty("rulesHasDate")]
        public bool RulesHasDate { get; private set; }

        [JsonProperty("clarifications")]
        public string Clarifications { get; private set; }
    }
}